/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mbean.admin.depot;

import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
import javax.ejb.EJB;
import model.entity.Depot;
import org.omnifaces.util.Faces;
import org.primefaces.model.LazyDataModel;
import service.InterfaceServiceLocal;
import utils.PageDateModel;

/**
 *
 * @author dingnangen
 */
@Named(value = "depotMB")
@SessionScoped
public class DepotMB implements Serializable {

    /**
     * Creates a new instance of DepotMB
     */
    public DepotMB() {
    }
     @EJB(beanName = "DepotManager")
    private InterfaceServiceLocal<Depot> depotManager;

    private LazyDataModel<Depot> items = null;
     
    private Depot currentDepot;

 

    /**
     * 初始化
     */
    public void init() {
        if (Faces.isPostback()) {
            System.out.println("isPostback");
            return;
        }
    }

    public LazyDataModel<Depot> getItems() {
         
        if (items == null) {
             
            items = new PageDateModel<Depot>("Depot", depotManager);

        }

        return items;
    }

    public void setItems(LazyDataModel<Depot> items) {
        this.items = items;
    }

 

}
